Skip to content

Conversation

@hussein-awala
Copy link
Member

@hussein-awala hussein-awala commented Mar 8, 2023

closes: #28494


This PR creates a new provider SMTP to manage the connections, hooks and operators related to SMTP/email sending.

Once this provider is released, a second PR will be created to add it as pre-installed provider, deprecate the airflow.operators.email.EmailOperator and let it extends the new one with a support for Airflow config for b/c, and provide a new implementation for email backend (based on the hook).

@eladkal
Copy link
Contributor

eladkal commented Mar 11, 2023

I think this provider will also need to be added to the pre installed ones:

airflow/setup.py

Lines 690 to 699 in 275ef6c

# Those providers are pre-installed always when airflow is installed.
# Those providers do not have dependency on airflow2.0 because that would lead to circular dependencies.
# This is not a problem for PIP but some tools (pipdeptree) show those as a warning.
PREINSTALLED_PROVIDERS = [
"common.sql",
"ftp",
"http",
"imap",
"sqlite",
]

This is because currently the ability to send email is coupled with core and assuming we will deprecate the core operator in favor of the provider one we need the provider to be installed with Airflow.

@hussein-awala
Copy link
Member Author

hussein-awala commented Mar 11, 2023

I think this provider will also need to be added to the pre installed ones

@eladkal I cannot add before releasing the provider, because the Airflow setup uses PyPI package and not the local one, so as I mentioned in the description, I will create a new PR to do that once the provider is released.

Specify the extra parameters (as json dictionary)

* ``from_email``: The email address from which you want to send the email.
* ``disable_ssl``: If set to true, then a non-ssl connection is being used. Default is false. Also note that changing the ssl option also influences the default port being used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not mandatory but would be nice to have it as boolean field in the UI

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already added it (line)

@hussein-awala hussein-awala changed the title [WIP] Creating SMTP provider Creating SMTP provider Mar 13, 2023
@hussein-awala hussein-awala marked this pull request as ready for review March 13, 2023 20:43
@hussein-awala hussein-awala requested a review from potiuk as a code owner March 13, 2023 20:43
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@potiuk
Copy link
Member

potiuk commented Mar 14, 2023

Nice one @hussein-awala !

@potiuk potiuk merged commit 3fac5c3 into apache:main Mar 14, 2023
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating SMTP provider

4 participants